﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace FlyingCell
{
    /// <summary>
    /// Interaction logic for SmallAppMessage.xaml
    /// </summary>
    public partial class SmallAppMessage : UserControl
    {
        /// <summary>
        /// Display state
        /// </summary>
        private bool IsDisplayed = false;
        
        /// <summary>
        /// Constructor
        /// </summary>
        public SmallAppMessage()
        {
            InitializeComponent();

            Hide();
        }

        /// <summary>
        /// Display the Small Application Message
        /// </summary>
        public void Display(string Message)
        {
            MsgText.Text = Message;

            if (!IsDisplayed)
            {
                this.Visibility = Visibility.Visible;
                IsDisplayed = true;
            }
        }

        /// <summary>
        /// Hide the Small Application Message
        /// </summary>
        public void Hide()
        {
            if (IsDisplayed)
            {
                this.Visibility = Visibility.Hidden;
                IsDisplayed = false;
            }
        }
    }
}
